<%--
  Created by IntelliJ IDEA.
  User: 10033
  Date: 2021/7/9
  Time: 14:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<style type="text/css">
    @import url("/css/headfirst.css");
    @import url("/css/index.css");
</style>
<head>
    <title>推荐</title>
</head>
<body>
<header class="header">
    <h1><img style="height: 50px;width: 180px"
             src=""
             alt="">
    </h1>
    <form>
        <input type="text" name="search" placeholder="Search.." class="search">
    </form>
    <button class="searchButton searchButton2">立即搜索</button>
    <div class="login">
        <!-- 登录 -->
        <!-- 注册 -->
        <span><a href="/user/login_user.jsp"><input type="button" class="dlspan" value="登 录"/></a></span>&nbsp;&nbsp;
        <span><a href="/user/register_user.jsp"><input type="button" class="zcspan" value="注 册"/></a></span>
    </div>
</header>
<div class="topNav">
    <!-- 导航栏 -->
    <div style="float: left;">
        <button style="" class="links_button button dropdown">
            <a href="tuijian.jsp" style="text-decoration: none">推荐</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="yingshi.jsp" style="text-decoration: none">影视</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="yinyue.jsp" style="text-decoration: none">音乐</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="youxi.jsp" style="text-decoration: none">游戏</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="tiyu.jsp" style="text-decoration: none">体育</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="zongyi.jsp" style="text-decoration: none">综艺</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="yule.jsp" style="text-decoration: none">娱乐</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="dongman.jsp" style="text-decoration: none">动漫</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="shenghuo.jsp" style="text-decoration: none">生活</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="meishi.jsp" style="text-decoration: none">美食</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
        <button style="" class="links_button button dropdown">
            <a href="chongwu.jsp" style="text-decoration: none">宠物</a>
            <span class="dropdown-content">
                    <a href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                </span>
        </button>
    </div>
</div>


<!-- </div> -->
<div id="content">
    <c:choose>
        <c:when test="${empty requestScope.hotList}">
            <c:if test="${empty requestScope.loaded}">
                <!-- 如果没有加载数据,先加载数据-->
                  <script>
                      window.location.href='/index';
                  </script>
            </c:if>
            <span style="color: red">未找到任何分类视频</span>
        </c:when>
        <c:otherwise>
            <c:forEach items="${requestScope.hotList}" var="hotMap">
                <ul class="sortul">
                    <!-- 内容 -->
                    <li class="sortlist">
                        <div class="sortdiv1">
                            <h1><span class="words">${hotMap.type}</span></h1>
                            <c:choose>
                                <c:when test="${empty hotMap.sortList}">
                                    <span style="color: #0000FF">该分类暂无视频</span>
                                </c:when>
                                <c:otherwise>
                                    <ul style="list-style: none;">
                                        <c:forEach items="${hotMap.sortList}" var="video">
                                            <li class="ul_li"><a href="/videos/${video.id}.html" target="_blank"><img src="${video.logo}" alt="${video.title}" width="300" height="200"></a>
                                                <p><a title="${video.title}">${video.title}</a></p>
                                            </li>
                                        </c:forEach>
                                    </ul>
                                </c:otherwise>
                            </c:choose>
                        </div>
                    </li>
                </ul>
            </c:forEach>

        </c:otherwise>

    </c:choose>
</div>


</body>
</html>
